package com.yueban.activity;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.yueban.R;
import com.yueban.model.BaseResponse;
import com.yueban.util.SPManager;

public class AccountActivity extends AppCompatActivity {

    private Button exitAccount;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_account);

        exitAccount = (Button) findViewById(R.id.exit_account);

        exitAccount.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                SPManager spManager = new SPManager(getApplicationContext());
                spManager.setPassword("");
                spManager.setAccount("");
                gotoLogin();
            }
        });
    }

    public void gotoLogin()
    {
        Intent intent = new Intent();
        intent.setClass(this, LoginActivity.class);
        intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
        startActivity(intent);
    }
}
